package com.itheima.reggie.common;

import java.util.Map;

/**
 * @author ：sean
 * @date ：Created in 2022/5/19
 * @description ：公共类
 * 通过ThreadLocal，存储同一线程中公共数据
 * @version: 1.0
 */
public class BaseContext {
	// 用户登录ID
	public static final  ThreadLocal<Long> THREAD_LOCAL_USER_ID = new ThreadLocal();
	//
	public static final  ThreadLocal<Map> THREAD_LOCAL_MAP = new ThreadLocal();

	public static void setCurrentId(Long id){
		THREAD_LOCAL_USER_ID.set(id);
	}

	public static Long getCurrentId(){
		return THREAD_LOCAL_USER_ID.get();
	}
}
